Skip to content

test(agc): give the runtime buffer span reference tests the same cold-cache room - #21641

Closed
edubox wants to merge 1 commit into
boykopovar:mainfrom
edubox:fix/agc-spans-cold-cache
Closed

edubox wants to merge 1 commit into
boykopovar:mainfrom
edubox:fix/agc-spans-cold-cache

Conversation

@edubox

@edubox edubox commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What

agc_driver_runtime_buffer_spans_x{2,3,4}_reference keep the 30 s default while they compile the pipelines they dispatch, and on a cold Mesa shader cache that is most of their wall time. Measured on llvmpipe (Mesa 26.2.6) with MESA_SHADER_CACHE_DIR pointing at an empty directory, one test at a time:

test cold warm
x2 --check-spans / --reference 6.2 s / 6.5 s 0.3 s / 0.3 s
x3 --check-spans / --reference 8.3 s / 8.3 s 0.8 s / 0.7 s
x4 --check-spans / --reference 11.0 s / 10.5 s 1.0 s / 0.9 s

--check-spans and --reference cost the same: it is the pipeline compilation both modes pay, not the span lookup. The Linux job runs four of these at once on a shared runner, and the two mode-agnostic failures of run 43841416406 (x3_spans, x4_spans) are what the 120 s budget addresses.

main now gives the spans mode 120 s (57d9769). This branch keeps that budget and extends it to the reference mode, which pays the same cold-cache cost and would flake the same way. The _fault_stop/_fault_barrier variants dispatch one case (0.3 s cold) and keep 30 s.

Tested

Configured the merged tree and checked the generated CTest properties: the six matrix tests now carry TIMEOUT 120, the two fault variants keep 30 s. ctest -R "^agc_driver_runtime_buffer_spans_x" -j4 with a fresh MESA_SHADER_CACHE_DIR and VK_ICD_FILENAMES on Mesa lavapipe 26.2.6: 6/6 pass, slowest 10.97 s (x4_spans). Same six pass on an NVIDIA RTX 4080 SUPER. No code change, so no behavior to test beyond the tests running.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (test timeouts only); measured on llvmpipe (Mesa 26.2.6, software) and on an NVIDIA RTX 4080 SUPER, 620.70.6
  • AI-assisted: yes

Summary by CodeRabbit

  • Tests
    • Applied the 120-second timeout to both spans and reference test modes.

@github-actions github-actions Bot added build agc libSceAgc* labels Nov 16, 2026
@domx4q

domx4q commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Measured this PR on lavapipe under CI-like contention and on an RTX 4090.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, Intel i9-14900KF. GPUs: lavapipe (Mesa 26.2.7, LLVM 23.1.4) and NVIDIA GeForce RTX 4090 (620.70.06). Base main 7c444b7 with this PR's diff applied.

Command: this approximates the 16-thread runner, which runs 15 tests at once on lavapipe with no usable shader cache:

taskset -c 0-15 env MESA_SHADER_CACHE_DISABLE=true LP_NUM_THREADS=16 ANYPS5_GPU=llvmpipe ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx \
  ctest --test-dir build -R '^agc_driver_runtime_buffer_spans_' -j 15 --timeout 120
test main this PR (TIMEOUT 60)
x2_spans 19.7 s 26.4 s
x3_spans 25.9 s 36.5 s
x4_spans Timeout 30.0 s 44.8 s
x2_reference / x3_reference / x4_reference 8.8 / 11.8 / 15.0 s 10.7 / 16.4 / 21.6 s

The two columns are separate runs under different host load, so they are not a timing comparison. They show that the PR makes the tests pass by allowing up to 60 s, and that x3_spans and x4_spans then take 36 to 45 s. The CI step "Report tests slower than 30 s" would flag them on every run. CONTRIBUTING.md says: "Split or shrink a test that gets close instead of raising its timeout." On the RTX 4090 all 8 pass in about 1 s each, with or without the PR.

Two observations on the measurements in the description:

  • In my runs --check-spans is not the same cost as --reference. Under contention, x2_spans took 24.8 s and x2_reference 10.9 s, and the _spans shaders are larger (about 6,750 SPIR-V words per case against about 4,380 for --reference, x4). Pipeline compilation still dominates both modes. Timing the x4 --check-spans run case by case gave 0.78 s of ShaderRecompiler::Recompile in total and 29.0 s in Dispatch + WaitIdle for the 112 cases, spread evenly over wave size, GLC and barrier.
  • The runner behaves like a cold Mesa cache: x2_spans took 22.6 s there (run 43841416406). Here it takes 17.0 s run alone with MESA_SHADER_CACHE_DISABLE=true and 1.7 s with a warm cache.

As an alternative that keeps the 30 s limit, fix/agc-runtime-buffer-spans-split (domx4q/AnyPS5) splits each matrix test by wave size and GLC into four ctest entries: 26 tests, with the same 112 cases per original test. With the same command, its slowest test takes 12.6 s at -j 8 and 19.6 s at -j 15. It touches the same cmake file as this PR, so only one of the two can merge as is.

AI-assisted: yes (Claude Code)

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 15456 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake
PR 22434 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake
PR 22546 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake
PR 22647 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake
PR 27133 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head 5567aff5ca, applied with git apply on main fd4aeed483 together with the other 29 PRs of one batch (#17478, #21223, #24030, #24201, #14202, #18889, #19531, #21773, #22468, #22471, #23239, #23255, #23484, #23869, #23992, #24311, #18425, #21195, #21255, #22989, #23507, #23886, #14582, #17878, #19666, #19899, #20138, #21656, #21746). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
agc_driver_runtime_buffer_spans, agc_driver_runtime_buffer_spans_x2_spans, agc_driver_runtime_buffer_spans_x3_reference and 3 more (6 tests, matched by name to the test file this PR changes) all pass all pass

Whole batch: the full ctest -j 12 (6522 tests) on the RTX 3080 has 4 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked. The 2125 agc_/video tests on the iGPU have 2 failing: agc_driver_stencil_plane_memory, agc_driver_store_over_untracked (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The timeout change matches the reported cold-start runtime and does not alter test behavior.

What I ran

Reviewed head 5567aff5ca57fd2ba9a7a978d253fe3e27c1d71a. I read the description, commit summary, manifest, diff, and complete changed CMake file. I did not run tests; the test results in the description are author-reported.

Results

Check Result Note
Diff and changed file review passed One timeout increase
Test execution not run Author reports six passes

Findings

Blocking

None.

Non-blocking

None.

Not verified

Runtime measurements and reported test runs were not independently verified. files.json and repository files outside the changed CMake file were not read; the manifest lists only that one changed file.

To get this to a good state

Nothing is required.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 24, 2026
@edubox edubox changed the title test(agc): give the runtime buffer span tests room for a cold pipeline cache test(agc): give the runtime buffer span reference tests the same cold-cache room Nov 25, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The timeout change is consistent with the stated cold-cache rationale and affects only the spans and reference matrix tests.

What I ran

Read the prepared description, commit list, manifest, diff, and the changed CMake file at head c7764f4de0379351d2bf9b24b3ba4bfd6ca72db6. No commands or tests were run.

Results

Check Result Note
Patch and changed file passed Timeout scope matches the test modes
Test execution not run Author-reported runs only

Findings

Blocking

None.

Non-blocking

None.

Not verified

The reported CTest runs on Mesa and NVIDIA were not run independently. Only the one changed file was read; no excluded files were listed in the provided manifest.

To get this to a good state

Nothing is required.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 25, 2026
…e cache

Both matrix modes compile the same pipelines, so both cost the same cold:
6.2 s (x2), 8.3 s (x3) and 11.0 s (x4) on llvmpipe with MESA_SHADER_CACHE_DIR
empty, against 0.3-0.9 s warm, and the Linux job runs four tests at once on
a shared runner, where x3 and x4 went past the 30 s limit. The fault
variants dispatch one case and stay at 30 s.
@edubox
edubox force-pushed the fix/agc-spans-cold-cache branch from c7764f4 to 33e8051 Compare November 29, 2026 17:15
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Runtime buffer test timeout

Layer / File(s) Summary
Extend timeout condition
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake
The timeout condition now includes reference mode as well as spans mode. Both modes use the existing 120-second timeout.

Suggested reviewers: boykopovar, domx4q

Change: Other

Merge Risk: Minimal · up to 33e80

This change only raises the test timeout for the reference-mode runtime buffer tests. It does not change product behavior, and it carries no meaningful merge risk.

Architecture risk: Low · up to 33e80

The change affects 1 source area.

Changed areas: core

Review details

Systems and components

  • observed — 1 changed file mapped to core.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8dfc43b4-ef93-4b28-bb8a-76ccf4753836
Commits

Reviewing files that changed from the base of the PR and between 6f6f6c8 and 33e8051.

Files selected for processing: 1

  • core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The timeout condition covers both matrix modes, including reference, while leaving fault tests at the existing 30-second timeout.

What I ran

Reviewed head 33e805144ff3e0c69dc4145a5944e22ba8f0cb11 against main using the prepared diff and repo_read.py. No tests or builds were run.

Results

Check Result Note
Diff and changed file passed One CMake test definition
Tests and build not run No execution performed

Findings

Blocking

None.

Non-blocking

None.

Not verified

The author reports CTest success on lavapipe and NVIDIA hardware; those runs were not independently verified. Read core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake and the prepared description, commits, manifest, and diff. No files were excluded according to the manifest.

To get this to a good state

Nothing is required.

@edubox

edubox commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (6f6f6c8e6b) at 33e805144ff. main had meanwhile added the wave/GLC loop; the resolution keeps that loop and gives both matrix modes TIMEOUT 120 (spans and reference), while the fault variants keep 30 s. No other change.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

#22123 has merged and split these tests by wave size and coherence state, so each reference test now runs on its own with the 30 s limit. Raising the reference limit to 120 on the old numbers (x3 and x4 spans took 36 to 45 s before the split) may no longer be needed. Could you rebase and show a cold-cache run of the reference tests on current main with a duration over 30 s on Linux or Windows? With that I will pass the one line change; without it the extra room just hides slow tests. If they now fit in 30 s, closing this is fine.

@edubox

edubox commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Following #22123's split I rebased this onto main (700fae9438) and measured the reference quarters on the current test registration. The tests already run with ANYPS5_NO_SHADER_CACHE=1, so every run compiles its pipelines, and ANYPS5_REQUIRE_VULKAN=1 was set (Linux, NVIDIA GeForce RTX 4080 SUPER, driver 620.85.02):

1/12 Test #3465: agc_driver_runtime_buffer_spans_x2_reference_wave32_glc0 ... Passed 0.74 sec
2/12 Test #3466: agc_driver_runtime_buffer_spans_x2_reference_wave32_glc1 ... Passed 0.42 sec
3/12 Test #3467: agc_driver_runtime_buffer_spans_x2_reference_wave64_glc0 ... Passed 0.45 sec
4/12 Test #3468: agc_driver_runtime_buffer_spans_x2_reference_wave64_glc1 ... Passed 0.45 sec
5/12 Test #3473: agc_driver_runtime_buffer_spans_x3_reference_wave32_glc0 ... Passed 0.44 sec
6/12 Test #3474: agc_driver_runtime_buffer_spans_x3_reference_wave32_glc1 ... Passed 0.43 sec
7/12 Test #3475: agc_driver_runtime_buffer_spans_x3_reference_wave64_glc0 ... Passed 0.47 sec
8/12 Test #3476: agc_driver_runtime_buffer_spans_x3_reference_wave64_glc1 ... Passed 0.47 sec
9/12 Test #3481: agc_driver_runtime_buffer_spans_x4_reference_wave32_glc0 ... Passed 0.47 sec
10/12 Test #3482: agc_driver_runtime_buffer_spans_x4_reference_wave32_glc1 ... Passed 0.47 sec
11/12 Test #3483: agc_driver_runtime_buffer_spans_x4_reference_wave64_glc0 ... Passed 0.50 sec
12/12 Test #3484: agc_driver_runtime_buffer_spans_x4_reference_wave64_glc1 ... Passed 0.50 sec
100% tests passed out of 12

The slowest quarter is 0.74 s, so the 30 s limit has ample room and the extra reference room is no longer needed. Closing as you suggested.

@edubox edubox closed this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants